import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)


const app = {
	state: {
		systemInfo: uni.getSystemInfoSync() || {},
		requestInfo: { // 请求锁
			loading: false,
			request: null,
			count: 0,
		},
		codes: {}
	},
	getters: {},
	mutations: {
		// 设置登录信息
		setRequestCount(state, count) {
			state.requestInfo.count += count
			if (state.requestInfo.count < 0) state.requestInfo.count = 0
		},

		setRequestLoading(state, loading) {
			state.requestInfo.loading = loading
		},
	},

}


export default app
